﻿@model Developer.Entity.CompanyType
@{
    Layout = "/Areas/Admin/Views/Shared/_PopLayout.cshtml";
}
<article class="page-container">
    <form class="form form-horizontal" id="form-admin-add" action="/admin/company/edit" method="post">
        <input hidden="" value="@Model.Id" id="id" name="typeId" />
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">分类名称：</label>
            <div class="formControls col-xs-8 col-sm-10">
                <input type="text" class="input-text" value="@Model.Name" placeholder="" id="typename" name="typename">
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-5 col-xs-offset-4 col-sm-offset-5">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<style>
    .select2-dropdown {
        background-color: #d2f3f0;
    }

    .select2-container .select2-choice {
        margin-left: -15px;
    }

    #s2id_managerid {
        width: 100%;
        padding-right: 0;
    }
</style>
<script type="text/javascript">

    @*$(function () {
        //The url we will send our get request to
        var attendeeUrl = '@Url.Action("GetAdmin", "Company")';
        var pageSize = 10;
        //console.log(page);
        if (@Model.ManagerId!=0) {
            $('#managerid').val(@Model.ManagerId).trigger('change');
        }
        $('#managerid').select2(
        {
            placeholder: '@(Model.ManagerId!=0?Model.User.Account:"---请选择管理员---")',
            //Does the user have to enter any data before sending the ajax request
            minimumInputLength: 0,
            allowClear: true,
            ajax: {
                //How long the user has to pause their typing before sending the next request
                quietMillis: 150,
                //The url of the json service
                url: attendeeUrl,
                dataType: 'json',
                //Our search term and what page we are on
                data: function (term, page) {
                    return {
                        pageSize: pageSize,
                        pageNum: page,
                        searchTerm: term
                    };
                },
                results: function (data, page) {
                    //Used to determine whether or not there are more results available,
                    //and if requests for more data should be sent in the infinite scrolling
                    var more = (page * pageSize) < data.Total;
                    return { results: data.Results, more: more };
                }
            }
        });

    });*@

    //$(function () {
    //    $('.skin-minimal input').iCheck({
    //        checkboxClass: 'icheckbox-blue',
    //        radioClass: 'iradio-blue',
    //        increaseArea: '20%'
    //    });
    //    $("#form-admin-add")
    //        .validate({
    //            rules: {
    //                name: {
    //                    required: true,
    //                    minlength: 2,
    //                    maxlength: 32
    //                },
    //                contactname: {
    //                    required: true,
    //                    maxlength: 50
    //                },
    //                mobile: {
    //                    required: true,
    //                    isMobile: true
    //                },
    //                managerid: {
    //                    required: true
    //                },
    //                workernum: {
    //                    required: true,
    //                    min: 1
    //                }
    //            },
    //            onkeyup: false,
    //            focusCleanup: true,
    //            success: "valid"

    //        });
    //});

    //init_uploader(1);//参数为限制上传的图片数量

</script>
